package com.niit.web.controller;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.niit.bean.Job;
import com.niit.service.JobService;
import com.niit.service.impl.JobServiceImpl;
import com.niit.utils.Page;
import com.niit.utils.WebKit;

@WebServlet("/ShowJobController")
public class ShowJobController extends HttpServlet {
	private static final long serialVersionUID = 1L;
  
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		doPost(request, response);
	}

	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		String pagenum = request.getParameter("curPage");
		JobService js = new JobServiceImpl();
		Page<Job> page = js.getPage(pagenum, WebKit.getServletURI(request));
		request.setAttribute("page", page);
		request.getRequestDispatcher("/jsp/admin/load/hirem2.jsp").forward(request, response);
	}

}
